import { IMessageBase } from "../../Framework/MQ/IMessageBase";
import { MessageManager } from "../../Framework/MQ/MessageManager";
import { SerializeStream } from "../../Framework/Serialize/SerializeStream";
import { EBusinessOperation } from "./EBusinessOperation";
import { SEntityId } from "./SEntityId";
import { SErrorMsg } from "./SErrorMsg";
import { SBusinessInfo } from "./SBusinessInfo";
type int = number;
//class SBusiness
    
    export  class SBusiness extends IMessageBase
    {
        constructor(arg1: Boolean=false)
        {
            
            super();if (arg1) 
            {
                MessageManager.instance().regist(this);
            }
            return;
        }

        public /* override */ getType(): int
        {
            return this._type;
        }

        public /* override */ clone(): IMessageBase
        {
            return new SBusiness();
        }

        public /* override */ __write(arg1: SerializeStream): void
        {
            this.operation.__write(arg1);
            this.fromEntity.__write(arg1);
            arg1.writeString(this.businessId);
            arg1.writeDate(this.endDt);
            this.error.__write(arg1);
            this.fromInfo.__write(arg1);
            this.toInfo.__write(arg1);
            return;
        }

        public /* override */ __read(arg1: SerializeStream): void
        {
            this.operation = EBusinessOperation.__read(arg1);
            this.fromEntity = new SEntityId();
            this.fromEntity.__read(arg1);
            this.businessId = arg1.readString();
            this.endDt = arg1.readDate();
            this.error = new SErrorMsg();
            this.error.__read(arg1);
            this.fromInfo = new SBusinessInfo();
            this.fromInfo.__read(arg1);
            this.toInfo = new SBusinessInfo();
            this.toInfo.__read(arg1);
            return;
        }

        public /* const */_type: int=20301;

        public /* var */operation: EBusinessOperation;

        public /* var */fromEntity: SEntityId;

        public /* var */businessId: string;

        public /* var */endDt: Date;

        public /* var */error: SErrorMsg;

        public /* var */fromInfo: SBusinessInfo;

        public /* var */toInfo: SBusinessInfo;

        public static /* var */_regist: SBusiness;
    }

            SBusiness._regist = new SBusiness(true);
        